var acl = function() {
    describe('ACL相关操作', function () {
        let key = 'demo.txt';
        let file = blob({ size: 1024 * 1024 * 5 });
        before('上传文件', function (done) {
            this.timeout(10000);
            ks3.putObject({
                key,
                file
            }).then(res => {
                console.log(res)
                should.not.exist(res.error);
                res.statusCode.should.be.equal(200);
                done()
            })
        })
        after('删除文件', function (done) {
            this.timeout(2000);
            ks3.delObject({
                key,
            }).then(res => {
                should.not.exist(res.error);
                res.statusCode.should.be.equal(204);
                done()
            })
        })
        describe('设置Object的ACL为private', function () {
            it('设置该文件的ACL为private', function (done) {
                this.timeout(2000);
                ks3.putObjectAcl({
                    key,
                    acl: 'private'
                }).then(res => {
                    should.not.exist(res.error);
                    res.statusCode.should.be.equal(200);
                    done();
                })
            })
            it('获取该文件的ACL', function (done) {
                this.timeout(2000);
                ks3.getObjectAcl({
                    key
                }).then(res => {
                    let grant = res.body.AccessControlPolicy.AccessControlList.Grant;
                    grant.Permission.should.be.equal('FULL_CONTROL');
                    should.not.exist(res.error);
                    res.statusCode.should.be.equal(200);
                    done();
                })
            })
        })
        describe('设置Object的ACL为public-read', function () {
            it('设置该文件的ACL为public-read', function (done) {
                this.timeout(2000);
                ks3.putObjectAcl({
                    key,
                    acl: 'public-read'
                }).then(res => {
                    should.not.exist(res.error);
                    res.statusCode.should.be.equal(200);
                    done();
                })
            })
            it('获取该文件的ACL', function (done) {
                this.timeout(2000);
                ks3.getObjectAcl({
                    key
                }).then(res => {
                    let grant = res.body.AccessControlPolicy.AccessControlList.Grant;
                    grant[0].Permission.should.be.equal('FULL_CONTROL');
                    grant[1].Permission.should.be.equal('READ');
                    should.not.exist(res.error);
                    res.statusCode.should.be.equal(200);
                    done();
                })
            })
        })
    })
}